{% extends '../../../layout.html' %}
<!-- header-start -->
{% block head %}
{% parent %}

<!--lCalendar.css-->
<link href="/component/lCalendar/lCalendar.css" rel="stylesheet" />
<!--LArea.css-->
<link href="/component/LArea/LArea.min.css" rel="stylesheet" />
{% endblock %}
<!-- header-end -->

<!-- body-start -->
{% block content %}
<div class="Hr_AddAddress">
    <div class="return_my_haier">
        <a href="javascript:void(0)" onclick="history.go(-1)">
            <div class="Return">
                <img src="/images/icon/left.png"/>
            </div>
        </a>
    </div>
    <div class="flex-box">
        <main>
            <form class="fields">
                <div class="field">
                    <label>联系人姓名</label>
                    <input id="name" type="text" name="name" autocomplete="off" placeholder="请输入" value="{{ thatData.ua_contact }}">
                </div>
                <div class="field">
                    <label>手机号码</label>
                    <input id="tel" type="text" name="tel" autocomplete="off" placeholder="电话号码、手机号码至少填一项"
                           onkeyup="this.value=this.value.replace(/\D/g,'')"
                           onafterpaste="this.value=this.value.replace(/\D/g,'')" value="{{ thatData.ua_mobile }}">
                </div>
                <!--
                <div class="field">
                    <label>验证码</label>
                    <div class="flex-dir-row field-verify align-center" style="width:100%;">
                        <input id="verify" name="verify" autocomplete="off" placeholder="验证码" type="text" maxlength="5"
                               onkeyup="this.value=this.value.replace(/\D/g,'')"
                               onafterpaste="this.value=this.value.replace(/\D/g,'')"/>
                        <img src="/images/icon/u58.png"/>
                        <a><p>换一个</p></a>
                    </div>
                </div>
                <div class="field">
                    <label>短信验证码</label>
                    <div class="flex-dir-row Add_YZ">
                        <input id="yz" name="yz" autocomplete="off" placeholder="" type="text" maxlength='6'
                               onkeyup="this.value=this.value.replace(/\D/g,'')"
                               onafterpaste="this.value=this.value.replace(/\D/g,'')"/>
                        <div class="yz-btn">
                            <input value="获取短信验证码" type="button" onclick="settime(this,$('#yz').val())"/>
                        </div>
                    </div>
                </div>
                -->
                <div class="field">
                    <label>电话号码</label>
                    <div class="flex-dir-row flex-between align-center" style="width: 100%;">
                        {% set ua_tel=thatData.ua_tel|default('-,')|split('-') %}
                        <input id="Address_code" name="Address_code" autocomplete="off" placeholder="区号" type="text"
                               maxlength="4" style="flex:1; margin-right:15px;"
                               onkeyup="this.value=this.value.replace(/\D/g,'')"
                               onafterpaste="this.value=this.value.replace(/\D/g,'')" value="{{ ua_tel[0]|default('') }}">
                        <input id="Address_phone_number" name="Address_phone_number" autocomplete="off"
                               placeholder="电话号码" type="text" maxlength="10" style="flex:2;margin-right:15px;"
                               onkeyup="this.value=this.value.replace(/\D/g,'')"
                               onafterpaste="this.value=this.value.replace(/\D/g,'')" value="{{ ua_tel[1]|split(',')[0]|default('') }}">
                        <input id="Address_extension" name="Address_extension" autocomplete="off" placeholder="分机号"
                               type="text" maxlength="5" style="flex:1;"
                               onkeyup="this.value=this.value.replace(/\D/g,'')"
                               onafterpaste="this.value=this.value.replace(/\D/g,'')" value="{{ ua_tel[1]|split(',')[1]|default('') }}">
                    </div>
                </div>
                <div class="field">
                    <label>省市区</label>
                    {#<input id="AddressCity" type="text" name="AddressCity" placeholder="请选择" readonly="readonly">#}
                    {#<input id="AddressCity_value1" type="hidden" value="20,234,504" readonly="readonly"/>#}

                    <div class="w-b-100 float-left m-b-10">
                        <select id="province" class="select" onchange="addAddress.changeProvince(this)"></select>
                    </div>
                    <div class="w-b-100 float-left m-b-10">
                        <select id="city" class="select" onchange="addAddress.changeCity(this)">
                        </select>
                    </div>
                    <div class="w-b-100 float-left m-b-10">
                        <select id="district" class="select" onchange="addAddress.changeDistrict(this)">
                        </select>
                    </div>
                </div>
                <div class="field Address_Textarea">
                    <label>详细地址</label>
                    <textarea name="Address_Detail_1" id="Address_Detail_1" cols="30" rows="10" autocomplete="off"
                              maxlength="90" placeholder="请尽可能的详细的填写街道、楼道、楼层、门牌号" onKeyDown="checkMaxInput(this)"
                              onKeyUp="checkMaxInput(this)">{{ thatData.ua_street }}</textarea>
                    <div class="Word_Limit">
                        <h5><span class="word">90</span>/90</h5>
                    </div>
                </div>
                <div class="field last-field">
                    <label>邮箱地址</label>
                    <input id="email" type="text" name="email" autocomplete="off" placeholder="请输入邮箱地址" value="{{ thatData.ua_email }}">
                </div>
                <div class="field last-field">
                    <label>邮政编码</label>
                    <input id="zipcode" type="text" name="zipcode" autocomplete="off" placeholder="请输入邮政编码" value="{{ thatData.ua_zipcode }}">
                </div>
                <div class="field last-field">
                    <div class="submit-field_forget remeberbox">
                        <label class="auto-login">
                            {% if thatData.ua_default==1 %}
                                <input id="remember-me" name="remember-me" type="checkbox" checked><span>设为默认地址</span>
                            {% else %}
                                <input id="remember-me" name="remember-me" type="checkbox"><span>设为默认地址</span>
                            {% endif %}
                        </label>
                    </div>
                </div>
                <div class="text-center m-t-10 m-b-10 m-l-10 m-r-10">
                    <a id="post" class="login login-btn" style="display: inline-block;" onclick="addAddress.post()">提交</a>
                </div>
            </form>
        </main>
    </div>
</div>
{% endblock %}
<!-- body-end -->
<!-- script-start -->
{% block script %}
    <!--lCalendar.js-->
    <script type="text/javascript" src="/component/lCalendar/lCalendar.min.js"></script>
    <!--LArea.js-->
    <script type="text/javascript" src="/component/LArea/LArea.min.js"></script>
    <!--LArea.Date-->
    <script type="text/javascript" src="/component/lCalendar/LAreaData1.js"></script>
    <script type="text/javascript" src="/js/base/app.js"></script>
    <script type="text/javascript" src="/js/base/lib/verify.js"></script>
    <script id="LoadOkRemove">
        var ADDRESS={};
        try {
            ADDRESS={{ thatData|json_encode|raw }};
        }catch (e){}
        $("#LoadOkRemove").remove();
    </script>
    <script type="text/javascript" src="/js/my-haier/add_address.js"></script>
{% endblock %}
<!-- script-end -->
